# import gmpy2
#
# if __name__ == '__main__':
#     # N在原题中远大于c
#     e = 3
#     c = 9
#     m = gmpy2.iroot(c, e)[0]
#     print(bytes.fromhex(hex(m)[2:]))
import gmpy2

if __name__ == '__main__':
    n = 145361143088137368699796462320730855062463020779323698477792694803159106138141725011423469347088987542460282148194800425189859183047413175832331798718208202679468004703784684748415142640766657055115592904301293708676459749413933645198729424559630273925417009918020260501161121867947943985644430805278568295931
    e = 65537
    c = 104072567009158954346955086782848984523522473254904683269880460911274339957079607180791174632391279966818046631608200628314427997654355105822835052674066382450449843393075054609830248214784738635695966418342514905315646190408258943686848288331468068172698190136731641280141170779816909529774013855935597383547
    sqr = gmpy2.iroot(n, 2)[0]
    p = 0
    q = 0
    for i in range(10000):
        if n % (sqr + i) == 0:
            p = sqr + i
            q = n // p
            break
    d = gmpy2.invert(e, (p - 1)*(q - 1))
    m = gmpy2.powmod(c, d, n)
    print(bytes.fromhex(hex(m)[2:]))
